package com.zk.shop.servlet.user;

import com.zk.shop.entity.User;
import com.zk.shop.util.JSONServlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @ClassName ShowUserOneServlet
 * @Description TODO
 * @Author 来永刚
 * @Date 2019/10/13 0013下午 4:57
 * @Version 1.0
 **/
@WebServlet("user/ShowUserOneServlet")
public class ShowUserOneServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        User user = (User) req.getSession().getAttribute("user");
        JSONServlet.getJson(req,resp,user);
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);
    }
}
